package cn.tedu.shoot;

import java.awt.image.BufferedImage;
import java.util.Random;

public class Bee extends FlyingObject implements Award{
	private int xspeed;
	private int yspeed;
	private int awardType;//奖励类型
	public Bee(){
		super(60,51);
		Random rand = new Random();
		xspeed = 1;
		yspeed = 2;
		awardType = rand.nextInt(2);
	}
	public void step() {
		x+=xspeed;
		y+=yspeed;
		if(x<=0 || x>=World.WIDTH-this.width) {
			xspeed*=-1;
		}
	}
	int index = 1;
	public BufferedImage getImage() {
		if(isLife()) {
	      return Images.bees[0];
	      }else if(isDead()) {
				BufferedImage img =  Images.bees[index++];
				if(index==Images.bees.length) {
				    state = REMOVE;
			     }
				return img;
			}
			return null;
		}
	   public int getAwardType() {
		   return awardType;
	   }
}
